﻿Public Class TableBook_Page
    Public Sub Initialize()
        TextBoxTableId.Text = ""
        TextBoxStartTime.Text = ""
        TextBoxOverTime.Text = ""
    End Sub

    Private Sub ButtonOK_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles ButtonOK.Click
        Try
            TableBook.book(Convert.ToInt32(TextBoxTableId.Text), Convert.ToDateTime(TextBoxStartTime.Text), Convert.ToDateTime(TextBoxOverTime.Text))
            MsgBox("预订成功!")
        Catch err As Exception
            MsgBox(err.Message)
        End Try
    End Sub

    Private Sub ButtonReSet_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles ButtonReSet.Click
        Initialize()
    End Sub

    Private Sub TableBook_Page_KeyDown(sender As Object, e As System.Windows.Input.KeyEventArgs) Handles Me.KeyDown
        If e.Key = Key.Return Then ButtonOK_Click(sender, New RoutedEventArgs)
    End Sub
End Class
